<?php

namespace app\common\services;

use app\common\enums\DelFlagEnum;

class ApiService
{
    public $condition = [
        ['del_flag', '=', DelFlagEnum::No]
    ];

    public $successCode = 200;

    public $successMsg = 'success';
    private $errorCode = 500;
    private $errorMsg = 'Error';



    public function success($data,$count = 0)
    {
        return ['code' => $this->successCode,'msg' => $this->successMsg,'data' => $data,'count' => $count];
    }

    public function fail($msg)
    {
        return ['code' => $this->errorCode,'msg' => $msg];
    }

}